<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>
<html>
    <head>
        <title>CMS_EDU安装程序</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link type="text/css" rel="stylesheet" href="http://127.0.0.1/cooldreamer/install/./Tpl/Public/css/setconfig.css"/>
    <link type="text/css" rel="stylesheet" href="http://127.0.0.1/cooldreamer/install/./Tpl/Public/css/index.css"/>
</head>
<body>
    <div class="setup">
        <div class="title">
            CMS_EDU Install
        </div>
        <div class="copy">

            <p>
                <?php echo $setup['version'];?>
            </p>
            <h3><em>CMS_EDU | </em>安装向导</h3>
        </div>
        <div class="body">
            <h2>环境检测</h2>
            <form action="<?php echo U('install_db');?>" method="post" name='installdb'>
                <table>
                    <tr>
                        <td style="width:120px;" align='right'>数据库连接主机：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_HOST]" value="<?php echo $setup['db']['dbhost'];?>"/></td>
                        <td style='color:#B5B5B5'>数据库连接主机地址</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>数据库用户名：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_USER]" value="<?php echo $setup['db']['dbuser'];?>"/></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>数据库密码：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_PASSWORD]" value="<?php echo $setup['db']['dbpassword'];?>"/></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>数据库名称：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_DATABASE]" value="<?php echo $setup['db']['dbname'];?>"/></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>端口：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_PORT]" value="<?php echo $setup['db']['dbport'];?>"/></td>
                        <td style='color:#B5B5B5'>一般数据库连接端口为3306</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>数据表前缀：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_PREFIX]" value="<?php echo $setup['db']['dbfix'];?>"/></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>数据库驱动：</td>
                        <td style="width:320px;">
                            <input type="radio" name="db[DB_DRIVER]" style="width:20px;" checked="checked"value="mysqli"/>
                            <strong>mysqli</strong></td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
                <!--目录检测-->
                <h2>管理员信息</h2>
                <table style="width:90%">
                    <tr>
                        <td style="width:120px;" align='right'>管理员名称：</td>
                        <td style="width:320px;">
                            <input type="text" name="admin[username]" value="<?php echo $setup['admin']['username'];?>"/>
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>管理员密码：</td>
                        <td style="width:320px;">
                            <input type="password" name="admin[password]" id='pwd'/>
                        </td>
                        <td style='color:#B5B5B5'>密码不要与管理员名称相同</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>重复密码：</td>
                        <td style="width:320px;">
                            <input type="password" name="admin[password2]" id = 'pwded'/>
                        </td>
                        <td style='color:#B5B5B5'>密码不要与管理员名称相同</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>管理员邮箱：</td>
                        <td style="width:320px;">
                            <input type="text" name="admin[email]" value="<?php echo $setup['admin']['email'];?>"/>
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                </table>


        </div>
        <div class="submit">
            <input type='submit' class='submit' value='下一步'/>
        </div>
    </form>
    <div class="step">
        <ul>
            <li style="color:#fff;font-weight:800">1.许可协议</li>
            <li style="color:#fff;">==></li>
            <li style="color:#fff;font-weight:800">2.环境检测</li>
            <li style="color:#fff;">==></li>
            <li style="color:#fff;font-weight:800">3.配置参数</li>
            <li style="color:#fff;">==></li>
            <li>4.安装数据库</li>
            <li>==></li>
            <li>5.完成安装</li>
        </ul>
    </div>
</div>
<script language-'javascript'>
    document.forms[0].onsubmit = function(){
        if (document.getElementById('pwd').value == '') {
            alert('请填写密码');
            return false;
        };
        if (document.getElementById('pwd').value != document.getElementById('pwded').value) {
            alert('两次密码不一致');
            return false;
        }
    }
</script>
</body>
</html>
